home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
Small Eiffel 0.4.8
/
man
/
external.hlp
< prev
next >
Wrap
Text File
|
1997-04-13
|
2KB
|
41 lines
Read this file if you want to call C code from Eiffel code (to
call Eiffel feature from C see cecil.hlp).
The most common way to call C code from Eiffel is to use
the `external' feature definition as described in ETL.
See also the SmallEiffel directory "lib_sow/external" to
have some examples.
Here is the current list of SmallEiffel `external' specifications.
1- external "C" -
Simple call to a C function (or procedure). The external called
routine do not get Current. A C prototype is automatically added
in generated heading C file.
2- external "CWC" -
Call With Current. The external called routine get Current as
first argument. A C prototype is automatically added in generated
heading C file.
3- external "IC" -
Inlined C call. Same as external "C", but no prototype generated.
4- external "ICWC" -
Inlined CWC call. Same as external "CWC", but no prototype
generated.
5- external "CSE" -
This external specification is reserved for SmallEiffel itself. Such
a feature is directly treated by `compile_to_c'. For example, infix "+"
of INTEGER is direcly mapped as C '+' for int C type.
6- Inlining C code -
Another way to call C code from Eiffel is to use "c_inline_c" or
"c_inline_h" as defined in GENERAL. The argument of "c_inline_c"
(or "c_inline_h") must always be a manifest string which may
contains the C code you want to put inlieu.
Using c_inline_[c/h] also suppose you know exactly the C code
SmallEiffel produce. For portability, it is better to use previous
solutions.